BIN=hello
CC=gcc
LFLAGS=-o
CFLAGS=-c
SRC=$(wildcard *.c)
OBJ=$(SRC:.c=.o)
RM=rm -f

$(BIN):$(SRC)
#	@$(CC) $(LFLAGS) $(OBJ) $(BIN)
	@$(CC) $(LFLAGS) $@ $^
	@echo "linking ... $^ to $@"

%.o:%.c
	@$(CC) $(CFLAGS) $<
	@echo "compling ... $< to $@"

.PHONY:clean 
clean:
	$(RM) $(OBJ) $(BIN)
